package com.mangguo.tingjian.content.controller;


import com.mangguo.tingjian.common.Result;
import com.mangguo.tingjian.content.dto.TagCountResult;
import com.mangguo.tingjian.content.service.IDwPlayerService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * play同步表 前端控制器
 * </p>
 *
 * @author auto
 * @since 2019-11-24
 */
@RestController
@RequestMapping("/content/dw-player")
@AllArgsConstructor
public class DwPlayerController {
    private final IDwPlayerService dwPlayerService;

    /**
     * 内容数据tag栏播放排名
     * @param start
     * @param end
     * @return
     */
    @GetMapping("/tag-order/{lvl1}/{lvl2}/{start}/{end}")
    public Result<List<TagCountResult>> simpleTag(@PathVariable("lvl1") Long lvl1,
                                                  @PathVariable("lvl2") Long lvl2,
                                                  @PathVariable("start") Integer start,
                                                  @PathVariable("end") Integer end){
        return Result.success(dwPlayerService.getTagPlayOrder(lvl1, lvl2, start, end));
    }
}
